# -*- coding: utf-8 -*-
# coding:utf-8
__author__ = 'lancelrq'

import os
import time
import funcs
os.setuid(1000)


if __name__ == '__main__':

    print("=========================\nWeJudge Judge Data Analysis Service\n=========================")
    print("请选择你要开启的服务：\n1. 比赛服即时代码查重系统")

    cmd = raw_input()
    if cmd == '1':
        print "请输入Contest_ID："
        contest_id = raw_input()
        print "请输入需要忽略的题目原始ID，多个用英文逗号隔开，不要有空格之类的，没有请直接按回车："
        ig_problems = raw_input()
        if ig_problems.strip() != '':
            ig_problems = unicode(ig_problems).split(',')
        else:
            ig_problems = []
        cca = funcs.ContestCodeAnalysis(int(contest_id), ig_problems)
        cca.start()

    while True:
        time.sleep(1)
        pass
